<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.util.log.Trace</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.util.log.Trace");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791">tango.util.log.Trace</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Oct 2007: Initial release<br><br>
<b>author:</b><br>Kris<br><br>        Synchronized, formatted console output. This can be used in lieu
        of true logging where appropriate.<br><br>        Trace exposes this style of usage:
        <pre class="d_code">

        <span class="i">Trace</span>.<span class="i">format</span> (<span class="sl">"abc {}"</span>, <span class="n">1</span>);             =&gt; <span class="i">abc</span> <span class="n">1</span>
        <span class="i">Trace</span>.<span class="i">format</span> (<span class="sl">"abc {}:{}"</span>, <span class="n">1</span>, <span class="n">2</span>);       =&gt; <span class="i">abc</span> <span class="n">1</span>:<span class="n">2</span>
        <span class="i">Trace</span>.<span class="i">format</span> (<span class="sl">"abc {1}:{0}"</span>, <span class="n">1</span>, <span class="n">2</span>);     =&gt; <span class="i">abc</span> <span class="n">2</span>:<span class="n">1</span>
        
</pre><br><br>        Special character sequences, such as "\n", are written directly to
        the output without any translation &#40;though an output-filter could
        be inserted to perform translation as required&#41;. Platform-specific
        newlines are generated instead via the formatln&#40;&#41; method, which also
        flushes the output when configured to do so:
        <pre class="d_code">

        <span class="i">Trace</span>.<span class="i">formatln</span> (<span class="sl">"hello {}"</span>, <span class="sl">"world"</span>);
        
</pre><br><br>        Explicitly flushing the output is achieved via a flush&#40;&#41; method
        <pre class="d_code">

        <span class="i">Trace</span>.<span class="i">format</span> (<span class="sl">"hello {}"</span>, <span class="sl">"world"</span>).<span class="i">flush</span>;
        
</pre><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>SyncPrint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L52">Trace</a></span>
<script>explorer.outline.addDecl('Trace');</script>; [public, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct Trace when this module is loaded</font><br><br>
<font color="black">global trace instance</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L65">SyncPrint</a></span>
<script>explorer.outline.addDecl('SyncPrint');</script>; [private]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Intended for internal use only</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L84">this</a></span>
<script>explorer.outline.addDecl('this');</script>(OutputStream <span class="funcparam">output</span>, Object <span class="funcparam">mutex</span>, bool <span class="funcparam">flush</span> = false);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct a Print instance, tying the provided stream
                to a layout formatter</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>SyncPrint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L98">format</a></span>
<script>explorer.outline.addDecl('format');</script>(char[] <span class="funcparam">fmt</span>, ...); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Layout using the provided formatting specification</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>SyncPrint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L111">formatln</a></span>
<script>explorer.outline.addDecl('formatln');</script>(char[] <span class="funcparam">fmt</span>, ...); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Layout using the provided formatting specification</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L129">flush</a></span>
<script>explorer.outline.addDecl('flush');</script>(); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Flush the output stream</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L141">sink</a></span>
<script>explorer.outline.addDecl('sink');</script>(char[] <span class="funcparam">s</span>); [private, final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Sink for passing to the formatter</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>SyncPrint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/util/log/Trace.d?rev=3791#L161">memory</a></span>
<script>explorer.outline.addDecl('memory');</script>(void[] <span class="funcparam">mem</span>); [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Print a range of raw memory as a hex dump.
                Characters in range 0x20..0x7E are printed, all others are
                shown as dots.</font><br><br>
<font color="black"><pre class="d_code">

<span class="n">000000</span>:  <span class="n">47</span> <span class="n">49</span> <span class="n">46</span> <span class="n">38</span>  <span class="n">39</span> <span class="n">61</span> <span class="n">10</span> <span class="n">00</span>  <span class="n">10</span> <span class="n">00</span> <span class="n">80</span> <span class="n">00</span>  <span class="n">00</span> <span class="n">48</span> <span class="n">5</span><span class="i">D</span> <span class="n">8</span><span class="i">C</span>  <span class="i">GIF89a</span>.......<span class="i">H</span>].
<span class="n">000010</span>:  <span class="i">FF</span> <span class="i">FF</span> <span class="i">FF</span> <span class="n">21</span>  <span class="i">F9</span> <span class="n">04</span> <span class="n">01</span> <span class="n">00</span>  <span class="n">00</span> <span class="n">01</span> <span class="n">00</span> <span class="n">2</span><span class="i">C</span>  <span class="n">00</span> <span class="n">00</span> <span class="n">00</span> <span class="n">00</span>  ...!.......,....
<span class="n">000020</span>:  <span class="n">10</span> <span class="n">00</span> <span class="n">10</span> <span class="n">00</span>  <span class="n">00</span> <span class="n">02</span> <span class="n">11</span> <span class="n">8</span><span class="i">C</span>  <span class="n">8F</span> <span class="i">A9</span> <span class="i">CB</span> <span class="i">ED</span>  <span class="n">0F</span> <span class="i">A3</span> <span class="n">84</span> <span class="i">C0</span>  ................
<span class="n">000030</span>:  <span class="i">D4</span> <span class="n">70</span> <span class="i">A7</span> <span class="i">DE</span>  <span class="i">BC</span> <span class="i">FB</span> <span class="n">8F</span> <span class="n">14</span>  <span class="n">00</span> <span class="n">3</span><span class="i">B</span>                     .<span class="i">p</span>.......;
                
</pre><br><br></font><br><br></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2007 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:32 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>